﻿//----------------------------------------------------------------
// <copyright file="WorkItemSummary.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//----------------------------------------------------------------

using MptCodeLibrary.Exceptions;

namespace MptCodeLibrary.TeamFoundation
{
    /// <summary>
    /// This class is used as storage for a work item.  This will help
    /// in creating unit tests and making the code much easier to write 
    /// </summary>
    public class WorkItemSummary
    {
        public WorkItemSummary(int workItemId, string title, string projectName,  string workItemType)
        {
            WorkItemId = workItemId;
            Title = title;
            ProjectName = projectName;

            WorkItemType = workItemType;
        }

        public int WorkItemId { get; protected set; }
        public string Title { get; protected set; }
        public string ProjectName { get; protected set; }

        private string workItemType;
        public string WorkItemType 
        {
            get { return workItemType; }
            protected set
            {
                switch (value)
                {
                    case "Value Proposition":
                    case "Feature Group":
                    case "Feature":
                    case "Deliverable":
                    case "Task":
                    case "Bug":
                        workItemType = value;
                        break;
                    default:
                        throw new MptException("Unknown work item type supplied: " + value);
                }
            } 
        }
    }
}
